home *** CD-ROM | disk | FTP | other *** search
/ Cre@te Online 2000 December / Cre@teOnline CD05.iso / MacSoft / XML ConsoleMax.sea / XML ConsoleMax / Required / esc.jar / com / extensibility / app / OpenURIDialog.class (.txt) < prev    next >
Encoding:
Java Class File  |  2000-06-30  |  3.5 KB  |  102 lines

  1. package com.extensibility.app;
  2.  
  3. import com.extensibility.plugin.api.ResLocationPlugin;
  4. import com.extensibility.plugin.api.ResLocationPluginPanel;
  5. import com.extensibility.plugin.api.URIScheme;
  6. import com.extensibility.rock.RAction;
  7. import com.extensibility.xml.URI;
  8. import java.awt.Container;
  9. import java.awt.Frame;
  10. import java.awt.Window;
  11. import java.io.File;
  12. import javax.swing.AbstractButton;
  13. import javax.swing.Box;
  14. import javax.swing.JButton;
  15.  
  16. public class OpenURIDialog extends SaveURIDialog {
  17.    RAction newAction = new 1(this);
  18.    public boolean isNewURI = false;
  19.    String[] myOpenTypes = null;
  20.    private boolean showNew = false;
  21.  
  22.    public OpenURIDialog(Frame var1, URI var2, String[] var3) {
  23.       super(var1, var2);
  24.       this.myOpenTypes = var3;
  25.    }
  26.  
  27.    public OpenURIDialog(Frame var1, URI var2, String[] var3, String var4) {
  28.       super(var1, var2, var4);
  29.       this.myOpenTypes = var3;
  30.    }
  31.  
  32.    public OpenURIDialog(Frame var1, URI var2, String[] var3, boolean var4) {
  33.       super(var1, var2);
  34.       this.myOpenTypes = var3;
  35.       this.showNew = var4;
  36.    }
  37.  
  38.    public OpenURIDialog(Frame var1, URI var2, String[] var3, String var4, boolean var5) {
  39.       super(var1, var2, var4);
  40.       this.myOpenTypes = var3;
  41.       this.showNew = var5;
  42.    }
  43.  
  44.    protected void fillButtonBox(Box var1) {
  45.       if (this.showNew) {
  46.          ((Container)var1).add(Box.createHorizontalStrut(8));
  47.          JButton var2 = new JButton(UI.getString("dialog.new"));
  48.          ((AbstractButton)var2).addActionListener(this.newAction);
  49.          ((AbstractButton)var2).setMnemonic(UI.getMnemonic("dialog.new"));
  50.          ((Container)var1).add(var2);
  51.       }
  52.  
  53.       super.fillButtonBox(var1);
  54.    }
  55.  
  56.    public boolean isNew() {
  57.       return this.isNewURI;
  58.    }
  59.  
  60.    protected void prepare() {
  61.       super.prepared = true;
  62.       super.bSaving = false;
  63.       if (super.title == null) {
  64.          super.title = UI.getString("dialog.open.uri.title");
  65.       }
  66.  
  67.       super.prepare();
  68.    }
  69.  
  70.    protected boolean pluginIsAppropriate(ResLocationPlugin var1) {
  71.       return var1.canOpen((String)null);
  72.    }
  73.  
  74.    protected ResLocationPluginPanel getPluginPanel(ResLocationPlugin var1) {
  75.       return var1.getOpenPanel(this);
  76.    }
  77.  
  78.    public void okSave(URIScheme var1) {
  79.    }
  80.  
  81.    public void okOpen(URIScheme var1) {
  82.       super.uri = new URI(var1);
  83.       ((Window)this).dispose();
  84.    }
  85.  
  86.    public File askFile(String var1, String[] var2) {
  87.       return var2 == null ? super.askFile(var1, this.myOpenTypes) : super.askFile(var1, var2);
  88.    }
  89.  
  90.    protected void doNew() {
  91.       SaveURIDialog var1 = new SaveURIDialog(Desktop.getDialogParent(this), super.baseURI);
  92.       var1.show();
  93.       URI var2 = var1.getURI();
  94.       if (var2 != null) {
  95.          super.uri = var2;
  96.          this.isNewURI = true;
  97.          ((Window)this).dispose();
  98.       }
  99.  
  100.    }
  101. }
  102.